﻿using Business.Base.DB.DBRules;
using Business.Base.Enums;
using Business.Base.Model;
using Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Business.NPSH
{
    [Serializable]
    [DBTableAttribute("npsh_experiment")]
    public class NpshExperiment:Experiment
    {
        #region 私有变量
        #region 试验基本信息
        String pumpModel;          //产品型号
        String pumpCode;           //产品编号
        String pumpName;           //水泵名字
        String manufacturer;       //生产商
        String customer;           //客户名,指要求水泵测试的客户的名字
        #endregion

        #region 泵参数
        double pumpRatedFlow;         //泵的额定流量(m3/h)
        double pumpRatedHead;         //泵的额定扬程(m)			
        double pumpRatedPower;        // 泵的额定功率(kw)
        double pumpRatedNpsh;         //泵的额定汽蚀（m）
        double pumpRatedEfficiency;   //泵的额定效率(%)
        double dInlet;                //泵的进口管径(mm)
        double dOutlet;               //泵的出口管径(mm)				
        double impellerDia;           //叶轮直径(mm)		
        #endregion

        #region 电机参数
        double motorRatedSpeed;       //电机的额定转速(r/min)					
        MotorRatedVoltage motorRatedVoltage;     //电机的额定电压(V)				
        double motorRatedCurrent;     //电机的额定电流(V)				
        String motorWindingConnection; //电机的绕组接法					
        String motorWindingMaterial;   //电机的材料					
        double motorRatedEfficiency;   //电机的额定效率(%)		
        #endregion

        #region 环境参数
        double transformationRatio;    //试验的电流变比					
        double zInlet = Config.ZInlet;   //入口取压孔高度(mm)					
        double zOutlet = Config.ZOutlet; //出口取压孔高度(mm)				
      				
        double kInlet = Config.KInlet;    //进口摩擦系数						
        double kOutlet = Config.KOutlet;  //出口摩擦系数							
        string flowmeter;              //流量计编号(mm)							
        int flowmeterAddress;       //流量计在PLC中的地址	
        #endregion

        #region 结果数据
        double criticalNpsh;
        #endregion
        #endregion

        /// <summary>
        /// 出口取压长度，每个试验前录入，定死为出口管径的两倍
        /// </summary>
        [DBFieldAttribute("lOutlet")]
        public double LOutlet { get => 2 * DInlet; }
        /// <summary>
        /// 入口取压长度，每个试验前录入，定死为进口管径的两倍
        /// </summary>
        [DBFieldAttribute("lInlet")]
        public double LInlet { get => 2 * DOutlet; }

        #region 普通属性
        /// <summary>
        /// 泵产品额定流量
        /// </summary>
        [DBFieldAttribute("pumpRatedFlow")]
        public double PumpRatedFlow { get => pumpRatedFlow; set => pumpRatedFlow = value; }

        /// <summary>
        /// 泵产品额定扬程
        /// </summary>
        [DBFieldAttribute("pumpRatedHead")]
        public double PumpRatedHead { get => pumpRatedHead; set => pumpRatedHead = value; }
        [DBFieldAttribute("pumpRatedPower")]
        public double PumpRatedPower { get => pumpRatedPower; set => pumpRatedPower = value; }
        [DBFieldAttribute("pumpRatedNpsh")]
        public double PumpRatedNpsh { get => pumpRatedNpsh; set => pumpRatedNpsh = value; }
        [DBFieldAttribute("pumpRatedEfficiency")]
        public double PumpRatedEfficiency { get => pumpRatedEfficiency; set => pumpRatedEfficiency = value; }
        [DBFieldAttribute("dInlet")]
        public double DInlet { get => dInlet; set => dInlet = value; }
        [DBFieldAttribute("dOutlet")]
        public double DOutlet { get => dOutlet; set => dOutlet = value; }
        [DBFieldAttribute("impellerDia")]
        public double ImpellerDia { get => impellerDia; set => impellerDia = value; }
        [DBFieldAttribute("motorRatedSpeed")]
        public double MotorRatedSpeed { get => motorRatedSpeed; set => motorRatedSpeed = value; }
        [DBFieldAttribute("motorRatedVoltage")]
        public MotorRatedVoltage MotorRatedVoltage { get => motorRatedVoltage; set => motorRatedVoltage = value; }
        [DBFieldAttribute("motorRatedCurrent")]
        public double MotorRatedCurrent { get => motorRatedCurrent; set => motorRatedCurrent = value; }
        [DBFieldAttribute("motorWindingConnection")]
        public String MotorWindingConnection { get => motorWindingConnection; set => motorWindingConnection = value; }
        [DBFieldAttribute("motorWindingMaterial")]
        public String MotorWindingMaterial { get => motorWindingMaterial; set => motorWindingMaterial = value; }
        [DBFieldAttribute("motorRatedEfficiency")]
        public double MotorRatedEfficiency { get => motorRatedEfficiency; set => motorRatedEfficiency = value; }
        [DBFieldAttribute("transformationRatio")]
        public double TransformationRatio { get => transformationRatio; set => transformationRatio = value; }
        [DBFieldAttribute("zInlet")]
        public double ZInlet { get => zInlet; set => zInlet = value; }
        [DBFieldAttribute("zOutlet")]
        public double ZOutlet { get => zOutlet; set => zOutlet = value; }
        [DBFieldAttribute("kInlet")]
        public double KInlet { get => kInlet; set => kInlet = value; }
        [DBFieldAttribute("kOutlet")]
        public double KOutlet { get => kOutlet; set => kOutlet = value; }
        [DBFieldAttribute("flowmeter")]
        public string Flowmeter { get => flowmeter; set => flowmeter = value; }
        [DBFieldAttribute("flowmeterAddress")]
        public int FlowmeterAddress { get => flowmeterAddress; set => flowmeterAddress = value; }
        [DBFieldAttribute("criticalNpsh")]
        public double CriticalNpsh { get => criticalNpsh; set => criticalNpsh = value; }

        [DBFieldAttribute("pumpModel")]
        public string PumpModel { get => pumpModel; set => pumpModel = value; }
        [DBFieldAttribute("pumpCode")]
        public string PumpCode { get => pumpCode; set => pumpCode = value; }
        [DBFieldAttribute("pumpName")]
        public string PumpName { get => pumpName; set => pumpName = value; }
        [DBFieldAttribute("manufacturer")]
        public string Manufacturer { get => manufacturer; set => manufacturer = value; }
        [DBFieldAttribute("customer")]
        public string Customer { get => customer; set => customer = value; }

        #endregion


        //[DBFieldAttribute("phassAddress")]
        public override int PhassAddress => 544;

      
    }
}
